//
//	ZcoModelTokenData.m
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "ZcoModelTokenData.h"

NSString *const kZcoModelTokenDataData = @"data";
NSString *const kZcoModelTokenDataExp = @"exp";
NSString *const kZcoModelTokenDataIat = @"iat";

@interface ZcoModelTokenData ()
@end
@implementation ZcoModelTokenData




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(![dictionary[kZcoModelTokenDataData] isKindOfClass:[NSNull class]]){
		self.data = [[ZcoModelUser alloc] initWithDictionary:dictionary[kZcoModelTokenDataData]];
	}

	if(![dictionary[kZcoModelTokenDataExp] isKindOfClass:[NSNull class]]){
		self.exp = [dictionary[kZcoModelTokenDataExp] integerValue];
	}

	if(![dictionary[kZcoModelTokenDataIat] isKindOfClass:[NSNull class]]){
		self.iat = [dictionary[kZcoModelTokenDataIat] integerValue];
	}

	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	if(self.data != nil){
		dictionary[kZcoModelTokenDataData] = [self.data toDictionary];
	}
	dictionary[kZcoModelTokenDataExp] = @(self.exp);
	dictionary[kZcoModelTokenDataIat] = @(self.iat);
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	if(self.data != nil){
		[aCoder encodeObject:self.data forKey:kZcoModelTokenDataData];
	}
	[aCoder encodeObject:@(self.exp) forKey:kZcoModelTokenDataExp];	[aCoder encodeObject:@(self.iat) forKey:kZcoModelTokenDataIat];
}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.data = [aDecoder decodeObjectForKey:kZcoModelTokenDataData];
	self.exp = [[aDecoder decodeObjectForKey:kZcoModelTokenDataExp] integerValue];
	self.iat = [[aDecoder decodeObjectForKey:kZcoModelTokenDataIat] integerValue];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	ZcoModelTokenData *copy = [ZcoModelTokenData new];

	copy.data = [self.data copy];
	copy.exp = self.exp;
	copy.iat = self.iat;

	return copy;
}
@end
